package com.jizhi.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jizhi.entity.Doctor;
import com.jizhi.entity.Drugdictionary;
import com.jizhi.mapper.DrugdictionaryMapper;
import com.jizhi.service.DrugdictionaryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.sql.Wrapper;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 王书豪
 * @since 2020-11-17
 */
@Service
public class DrugdictionaryServiceImpl extends ServiceImpl<DrugdictionaryMapper, Drugdictionary> implements DrugdictionaryService {
    @Resource
    private DrugdictionaryMapper drugdictionaryMapper;
    @Override
    public List<Drugdictionary> filuPageAll(Page page,String name) {
        QueryWrapper<Drugdictionary> wrapper=new QueryWrapper<>();
        wrapper.like("drugName",name);
        IPage<Drugdictionary> drugdictionaryIPage = drugdictionaryMapper.selectPage(page, wrapper);
        return drugdictionaryIPage.getRecords();
    }

    @Override
    public Drugdictionary filuById(Integer id) {
        return drugdictionaryMapper.selectById(id);
    }
}
